package com.job.sun;

/**
 * @author 张春阳
 * @version 1.0
 * @since 2022-07-14 22:10:28
 */
public class Beauty implements Cloneable{
    private String name;
    Cat cat;

    public Beauty(String name, Cat cat) {
        this.name = name;
        this.cat = cat;
    }

    public Beauty(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Cat getCat() {
        return cat;
    }

    public void setCat(Cat cat) {
        this.cat = cat;
    }

    public static  void main(String[] args) throws CloneNotSupportedException {

        Cat cat =new Cat("Tomcat");
        Beauty beauty =new Beauty("行秋", cat);
        Beauty clone = (Beauty) beauty.clone();
        System.out.println(clone.getCat()==beauty.getCat());
        System.out.println(clone==beauty);

    }
}